package cn.xiyue.production.ui;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.xiyue.production.R;

public class TitleBar extends RelativeLayout {

    private ImageView btn_back;
    private TextView tv_lable;

    public TitleBar(Context context) {
        super(context);
        LayoutInflater.from(context).inflate(R.layout.layout_title_bar, this);
        tv_lable = findViewById(R.id.tv_lable);
        btn_back = findViewById(R.id.btn_back);
        btn_back.setOnClickListener(v -> ((Activity)getContext()).finish());
    }

    public void setLable(String lable){
        tv_lable.setText(lable);
    }


}
